﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/WebSite.Master" CodeBehind="ChangeSetRecordList.aspx.cs" Inherits="RN.ERP.Web.InfoChange.ChangeSetRecordList" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<style type="text/css">
.NoNewline
{
word-break: keep-all;/*必须*/
}
</style>
<script type="text/javascript" src="../Scripts/jquery.min.js"></script>
<script type="text/javascript" src="../Scripts/ligerUI/js/ligerui.min.js"></script>
<script type="text/javascript">
    $(function () {
        $("#btnSearch").click(function () {
            RefreshGrid("");
        });
    });

    function RefreshGrid(condition) {
        $("#<%= hdnCondition.ClientID %>").val(condition);
        $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
    }

    function getComments(sender, args) {
        var btn = args.get_item().get_text();
        if (btn == "审核") {
            PassExec();
        } else if (btn == "退回") {
            RejectExec();
        }
        else if (btn == "解锁退回") {
            UnlockRejectExec();
        }
    }

    function PassExec() {
        $.ligerDialog.prompt('审核意见', '', true, function (yes, value) {
            if (yes) {
                $("#<%= hdnComments.ClientID %>").val(value);
                $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Audit");
            }
            else {
                return false;
            }
        });
    }

    function RejectExec() {
        $.ligerDialog.prompt('退回意见', '', true, function (yes, value) {
            if (yes) {
                $("#<%= hdnComments.ClientID %>").val(value);
                $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Back");
            }
            else {
                return false;
            }
        });
    }

    function UnlockRejectExec() {
        $.ligerDialog.prompt('退回意见', '', true, function (yes, value) {
            if (yes) {
                $("#<%= hdnComments.ClientID %>").val(value);
                $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("UnlockBack");
            }
            else {
                return false;
            }
        });
    }
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<div class="table">
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="ListChangeSet" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="ListChangeSet">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="ListChangeSet" LoadingPanelID="RadAjaxLoadingPanel1">
                        </telerik:AjaxUpdatedControl>
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadSkinManager ID="QsfSkinManager" runat="server" ShowChooser="true" 
            Skin="MetroTouch" />
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
        <telerik:RadFormDecorator ID="FormDecorator1" runat="server" DecoratedControls="all"
            DecorationZoneID="deco1" Skin="Telerik"></telerik:RadFormDecorator>
        <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
            <tr>
                <td class="left_con">
                    &nbsp;
                </td>
                <td style="padding-left: 6px; padding-right: 6px;" valign="top">
                    <div id="deco1">
                        <div style="padding: 20px; font-size: 14px;">
                            <span style="float: left; padding-right: 10px; line-height: 38px;">变更项: </span>
                            <asp:TextBox ID="txtTitle" runat="server" Style="width: 200px; height: 25px; line-height: 25px;
                                float: left; padding-right: 10px"></asp:TextBox>&nbsp;&nbsp;&nbsp;
                            <asp:DropDownList ID="ddlStatus" runat="server" Style="width: 100px; height: 25px;
                                line-height: 31px; margin-top: 5px; border: 0;">
                            </asp:DropDownList>
                             <a href="../Person/PersonEmpStatistic2.aspx" id="btnBack" class="xtbiao">返回</a> 
                            <input type="button" id="btnSearch" class="xtbiao" value="查询" />
                        </div>
                    </div>
                    <div>
                        <telerik:RadAjaxPanel runat="server" ID="RadAjaxPanel" LoadingPanelID="RadAjaxLoadingPanel1"
                            HorizontalAlign="NotSet">
                            <telerik:RadGrid ID="ListChangeSet" runat="server" AutoGenerateColumns="False" CellSpacing="0"
                                Width="100%" Culture="zh-CN" GridLines="None" AllowFilteringByColumn="false"
                                AllowPaging="true" AllowCustomPaging="true" AllowMultiRowSelection="false" OnNeedDataSource="ListChangeSet_NeedDataSource"
                                AllowSorting="false" ShowStatusBar="true" Skin="Telerik" 
                                onitemdatabound="ListChangeSet_ItemDataBound">
                                <ClientSettings ReorderColumnsOnClient="True" AllowColumnsReorder="True" EnableRowHoverStyle="true">
                                    <Resizing AllowRowResize="True" EnableRealTimeResize="True" ResizeGridOnColumnResize="True"
                                        AllowColumnResize="True"></Resizing>
                                </ClientSettings>
                                <%--操作按钮--%>
                                <MasterTableView AutoGenerateColumns="false" DataKeyNames="ChangeSet.ID" Font-Size="14px"
                                    CommandItemDisplay="Top">
                                    <CommandItemSettings ExportToPdfText="导出PDF" />
                                    <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="false">
                                    </RowIndicatorColumn>
                                    <CommandItemTemplate>
                                     <telerik:RadToolBar ID="RadToolBar1" runat="server"  AutoPostBack="true"  
                                       OnClientButtonClicking="getComments" onload="RadToolBar1_Load" Skin="Office2007" Width="100%">
                                            <Items>
                                                <telerik:RadToolBarButton  CheckOnClick="true" runat="server"  Text="审核">
                                                </telerik:RadToolBarButton>
                                                <telerik:RadToolBarButton CheckOnClick="true"  runat="server" Text="退回">
                                                </telerik:RadToolBarButton>
                                                <telerik:RadToolBarButton CheckOnClick="true"  runat="server" Text="解锁退回">
                                                </telerik:RadToolBarButton>
                                            </Items>
                                        </telerik:RadToolBar>
                                    </CommandItemTemplate>
                                    <Columns>
                                        <telerik:GridTemplateColumn UniqueName="CheckBoxTemplateColumn" HeaderStyle-Width="50px">
                                            <HeaderTemplate>
                                                <asp:CheckBox ID="headerChkbox" runat="server" OnCheckedChanged="ToggleSelectedState"
                                                    AutoPostBack="True" />
                                            </HeaderTemplate>
                                            <ItemTemplate>
                                                <asp:CheckBox ID="CheckBox1" runat="server" OnCheckedChanged="ToggleRowSelection"
                                                    AutoPostBack="false"></asp:CheckBox>
                                            </ItemTemplate>
                                            <ItemStyle Width="50px"></ItemStyle>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridBoundColumn DataField="ChangeSet.ID" HeaderText="ID" UniqueName="ID" ReadOnly="true"
                                            Visible="false">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridTemplateColumn HeaderText="变更项名称" SortExpression="Name">
                                            <ItemTemplate>
                                                <a href="javascript:void(0);" onclick="ShowViewForm(' <%#((RN.ERP.Web.ModelService.ChangeDetail)Container.DataItem).ChangeSet.ObjectId%>')" title="点击查看信息">
                                                    <span style="color: #43a9f5">
                                                        <%#((RN.ERP.Web.ModelService.ChangeDetail)Container.DataItem).ChangeSet.ObjectName%></span></a>
                                            </ItemTemplate>
                                            <ItemStyle Width="60px"></ItemStyle>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn HeaderText="变更">
                                            <HeaderTemplate>
                                            <table width="100%">
                                            <tr><td  align="center" colspan="2">变更</td></tr>
                                            </tr>
                                            <tr><td width="50%" align="left">变更前</td><td width="50%" align="right">变更后</td></tr>
                                            </table>
                                            </HeaderTemplate>
                                            <ItemTemplate>                      
                                                      <%--  <%#GetChangeInfo(((RN.ERP.Web.ModelService.ChangeDetail)Container.DataItem).ChangeInfos)%>--%>
                                                <asp:Table ID="ChangeTable" runat="server" >
                                                </asp:Table>
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridBoundColumn DataField="ChangeSet.ObjectType" DataType="System.String" HeaderText="变更类型"
                                            HeaderStyle-HorizontalAlign="Center" SortExpression="ObjectType" UniqueName="ObjectType">
                                            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                                            <ItemStyle Width="90px"></ItemStyle>
                                        </telerik:GridBoundColumn>    
                                        <telerik:GridBoundColumn DataField="ChangeSet.Description" DataType="System.String" HeaderText="描述" HeaderStyle-HorizontalAlign="Center">
                                            <ItemStyle Width="150px"></ItemStyle>
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn HeaderText="审核流程码" DataField="ChangeSet.FlowCode" UniqueName="FlowCode"
                                            ItemStyle-Width="100px" Visible="false">
                                        </telerik:GridBoundColumn>
                                    </Columns>
                                </MasterTableView>
                                <ClientSettings EnableRowHoverStyle="true">
                                    <Selecting AllowRowSelect="True"></Selecting>
                                </ClientSettings>
                                <PagerStyle AlwaysVisible="True" />
                                <FilterMenu EnableImageSprites="False">
                                </FilterMenu>
                                <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                            </telerik:RadGrid>
                        </telerik:RadAjaxPanel>
                    </div>
                    <!--#专家列表结束-->
                </td>
                <td class="right_con">
                    &nbsp;
                </td>
            </tr>
        </table>
        <asp:HiddenField ID="hdnCondition" runat="server" />
        <asp:HiddenField ID="hidSysError" runat="server" />
        <asp:HiddenField ID="hdnComments" runat="server" />
       <telerik:RadWindowManager ID="RadWindowManager1" runat="server" Skin="WebBlue">
        </telerik:RadWindowManager>
    </div>
</asp:Content>

